home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODF-Interest Archive / July 96 / Changing a collection during it < prev    next >
Encoding:
Internet Message Format  |  1996-07-30  |  1.1 KB  |  [TEXT/ttxt]

  1. Subject:     Changing a collection during iteration
  2. Sent:        7/19/96 3:00 PM
  3. Received:    7/19/96 3:11 PM
  4. From:        Gary Ashcraft, ashcraft@dharbor.com
  5. Reply-To:    ODF Interest, ODF-Interest@CILabs.ORG
  6. To:          OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
  7.  
  8. Is modification of a collection allowed during iteration?  I understand that MacApp has lists that can have items inserted/deleted while one or more iterators are using them.
  9.  
  10. I've been unable to find any mention of of this in the ODF documentation, although a couple of member variables in PRList.h have the comment "Used only when deleting while iterating".
  11.  
  12. During iteration, if I remove an element before or after the current element, it appears to delete it.  I then get the assert "fSeed == fList->fSeed" on following iterations until I finish.  If I try to remove the current element, I get the same assert, then I die with an "access fault exception".
  13.  
  14. Will the next update of ODF allow deleting elements (including the current element) during iteration?
  15.  
  16. ----------------
  17. Regards,
  18.   Gary Ashcraft         ashcraft@dharbor.com
  19.   Digital Harbor
  20.  
  21.  
  22.